package com.heima.freemarker.controller;

import com.heima.freemarker.pojo.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/hello")
public class HelloController {

    @GetMapping
    public String test(Model model) {
        model.addAttribute("name", "光光是傻逼");

        Student student = new Student();
        student.setName("丁光军");
        student.setAge(12);

        model.addAttribute("stu", student);

        return "01-basic";
    }
}